package com.yy.ttmodule.control;


import android.content.Context;

import com.yy.ttmodule.R;

public class Constant {

    public static int NETWORK_NONE = 0x01;
    public static int NETWORK_4G = 0x02;

    public static String CLIENT_IP = "192.168.50.9";//192.168.10.100
    public static int CLIENT_PORT = 12001;
    public static String SERVER_IP = "192.168.50.9";
    public static int SERVER_PORT = 12000;

    public final static int EXC_SUCCEED = 0x00;
    public final static int EXC_FAILURE = 0x01;

    public final static int AIRPLANE_MODE_ON = 0x01;
    public final static int AIRPLANE_MODE_OFF = 0x02;

    public final static int PHONE_NUM_LEN = 11;

    public final static int CALL_STATE_IDLE = 0x00;
    public final static int CALL_STATE_RINGING = 0x01;
    public final static int CALL_STATE_OFFHOOK = 0x02;
    public final static int CALL_STATE_INCOMING = 0x03;

    public final static int CARD_NOR = 0x00;
    public final static int CARD_ABNOR = 0x01;

    public final static int DATA_PS_2_4 = 0x01;
    public final static int DATA_PS_4_8 = 0x02;
    public final static int DATA_PS_6_6 = 0x03;
    public final static int DATA_PS_9_6 = 0x04;
    public final static int DATA_PS_16 = 0x05;
    public final static int DATA_PS_32 = 0x06;
    public final static int DATA_PS_64 = 0x07;
    public final static int DATA_PS_128 = 0x08;
    public final static int DATA_PS_256 = 0x09;
    public final static int DATA_PS_384 = 0x0A;
    public final static int DATA_PS_OFF = 0x0F;
    public final static int DATA_PS_DO = 0x0F;

    public static int getQos2PsValue(Context context, int param) {
        int res = 0x0F;
        int[] arr = context.getResources().getIntArray(R.array.entryvalues_list_qos_maximum_bitrate_dl);
        for (int i = 0; i < arr.length; i++) {
            if ( arr[i] == param ) {
                res = i + 1;
                break;
            }
        }
        return res;
    }

    public static int getPs2QosValue(Context context, int param) {
        int res = -1;
        int[] arr = context.getResources().getIntArray(R.array.entryvalues_list_qos_maximum_bitrate_dl);
        if ( param <= arr.length && param > 0 ) {
            res = arr[param - 1];
        }
        return res;
    }

}
